# -*- coding:utf-8 -*-
"""
test the xiamihot.py crawler
"""
import unittest
from xiamihot import getallmusic

class TestXiamiHot(unittest.TestCase):
    def testxiamihot20110709(self):
        name1 = "想你想你"
        id1 = "1770229981"
        name2 = "I Love You, John"
        id2 = "1770234454"
        e1 = False
        e2 = False
        musics = getallmusic()
        for music in musics:
            if music['mname'] == name1 and music['mid'] == id1:
                e1 = True
            if music['mname'] == name2 and music['mid'] == id2:
                e2 = True
            if e1 and e2:
                break
        self.assertEqual(e1,True)
        self.assertEqual(e2,True)

if __name__ == "__main__":
    unittest.main()
